package cn.ainit.sys.framework.upload;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public interface UploadDao {

	List<Map<String, Object>> loadAllImgs(String dsId, String clnName,
			String pkValue) throws Exception;

	/**
	 * 保存图片信息
	 * @param uploadInfo
	 * @return
	 * @throws Exception
	 * @author Xuzq
	 * @date 2014-9-20 下午06:35:28
	 */
	boolean saveImgPath(SysUploadInfo uploadInfo)throws Exception;
	/**
	 * 将文件保存到服务器文件夹
	 * @param uploadInfo
	 * @return
	 * @throws Exception
	 */
	boolean saveFiles(SysUploadInfo uploadInfo)throws Exception;
	/**
	 * 讲过文件保存到数据库
	 * @param uploadInfo
	 * @return
	 * @throws Exception
	 */
	String  saveFilesToDb(SysUploadInfo uploadInfo)throws Exception;
	/**
	 * 查找所有的文件列表
	 * @param fileList
	 * @return
	 * @throws Exception
	 */
	SysFilesList getFileList(SysFilesList fileList)throws Exception;
	/**
	 * 删除指定文件
	 * @param delFile
	 * @return
	 * @throws Exception
	 */
	boolean delFile(SysUploadInfo delFile)throws Exception;
	/**
	 * 下载文件
	 * @param downFile
	 * @return
	 * @throws Exception
	 */
	SysUploadInfo downFile(SysUploadInfo downFile)throws Exception;
	/**
	 * 加载微博数量
	 * @param pkValue
	 * @return
	 * @throws Exception
	 */
	Integer getWCount(String pkValue)throws Exception;
	/**
	 * 加载微博数据
	 * @param pkValue
	 * @return
	 * @throws Exception
	 */
	List<WeiBoObj> loadWeiBo(String pkValue)throws Exception;
	
	
	/****
	 * 新版本的图片上传
	 * @param dsId
	 * @param uid
	 * @param session
	 * @param request
	 * @return
	 * @throws Exception
	 */
	Map<String,String> uploadTempImgs(String dsId,String colName,String uid,HttpSession session,HttpServletRequest request);

	
	/**
	 *  新版本把图片信息进入数据库
	 *
	 */
	void savePictureInfo(SysUploadInfo sysUploadInfo,String uid)throws Exception;
	
	
	/***
	 * 详情界面上传图片的时候 更新sys_upload_files_blob 的关联字段DJ_KEY_VALUE的值
	 * @param keyVal
	 * @throws Exception
	 */
	public void updateLoadImgs(String realkeyVal,String oldVal) throws Exception;
	
	
	/**
	 * 删除文件里的图片和DB相关数据
	 */
	String  deletedPictureById(HttpServletRequest request,
			HttpServletResponse response,HttpSession session);
	
	
}
